import Prelude

extension Reward.Shipping {
  public enum lens {
    public static let enabled = Lens<Reward.Shipping, Bool>(
      view: { $0.enabled },
      set: { .init(
        enabled: $0, location: $1.location, preference: $1.preference, summary: $1.summary, type: $1.type
      ) }
    )

    public static let location = Lens<Reward.Shipping, Reward.Shipping.Location?>(
      view: { $0.location },
      set: { .init(
        enabled: $1.enabled, location: $0, preference: $1.preference, summary: $1.summary, type: $1.type
      ) }
    )

    public static let preference = Lens<Reward.Shipping, Reward.Shipping.Preference?>(
      view: { $0.preference },
      set: { .init(
        enabled: $1.enabled, location: $1.location, preference: $0, summary: $1.summary, type: $1.type
      ) }
    )

    public static let summary = Lens<Reward.Shipping, String?>(
      view: { $0.summary },
      set: { .init(
        enabled: $1.enabled, location: $1.location, preference: $1.preference, summary: $0, type: $1.type
      ) }
    )

    public static let type = Lens<Reward.Shipping, Reward.Shipping.ShippingType?>(
      view: { $0.type },
      set: { .init(
        enabled: $1.enabled, location: $1.location, preference: $1.preference, summary: $1.summary, type: $0
      ) }
    )
  }
}
